﻿using System;
using System.Collections.Generic;
using System.Text;
using System.Web.UI;
using Antu.WebControls;
using Antu.Core.Components;
using Antu.Core.Services;
using System.Web.UI.WebControls;
using EluZSProvider;
using System.Web;
using System.Data;

namespace WebSys.UI.Control.ZhengShou
{
    public class hetongHBprintControl : MPBasicTemplate
    {
        EluZSDataProvider _EluZSDataProvider = (EluZSDataProvider)ProviderService.ProviderServiceMange.GetProvider("EluZSProvider");
        public static string fid, iid, url, tempurl, tempurlo;
        public string userid = string.Empty;
        protected override void OnLoad(EventArgs e)
        {
            base.OnLoad(e);
            Label dycs = (Label)FindControl("dycs");
            TextBox showtempurl = (TextBox)FindControl("showtempurl");
            TextBox showtempurlo = (TextBox)FindControl("showtempurlo");
            string strid = base.Page.Request["ID"];
            for (int temp = 1; temp < 13; temp = temp + 2)
            {
                string tempstr = "房屋征收货币补偿协议";
                if (temp<10)
                {
                    tempstr +="0"+ temp;
                }
                else
                {
                    tempstr += temp;
                }
                
                tempurl += Bind2(tempstr) + ";";
            }
            showtempurl.Text = tempurl.TrimEnd(';');
            for (int temp = 2; temp < 13; temp = temp + 2)
            {
                string tempstr = "房屋征收货币补偿协议";
                if (temp < 10)
                {
                    tempstr += "0" + temp;
                }
                else
                {
                    tempstr += temp;
                }

                tempurlo += Bind2(tempstr) + ";";
            }
            showtempurlo.Text = tempurlo.TrimEnd(';');
            EluZSProvider.Hbhxy hbhxy = _EluZSDataProvider.GetHbhxy(strid);
            dycs.Text = hbhxy.打印次数;
        }
        public static string Bind(string fname)
        {
            string strid = HttpContext.Current.Request["ID"];
            string strNewUrlName = System.Configuration.ConfigurationManager.AppSettings["WorkFlowService"].ToString();
            EluZSDataProvider _EluZSDataProvider = (EluZSDataProvider)ProviderService.ProviderServiceMange.GetProvider("EluZSProvider");
            fid = _EluZSDataProvider.GetBindFname(fname);
            iid = _EluZSDataProvider.GetSomeStr("zs_hbhxy", "iid", "id", strid);
            url = "../../../cjws//HtmlPage/HtmlMainPage.aspx?iid=" + iid + "&UserId=-1&FormName=" + fid + "&input_index=0&act=Print";
            return url;
        }
        public static string Bind2(string fname)
        {
            string strid = HttpContext.Current.Request["ID"];
            EluZSDataProvider _EluZSDataProvider = (EluZSDataProvider)ProviderService.ProviderServiceMange.GetProvider("EluZSProvider");
            fid = _EluZSDataProvider.GetBindFname(fname);
            iid = _EluZSDataProvider.GetSomeStr("zs_hbhxy", "iid", "id", strid);
            string strNewUrlName = System.Configuration.ConfigurationManager.AppSettings["WorkFlowService"].ToString();
            url = "../../../cjws//HtmlPage/HtmlMainPage.aspx?iid=" + iid + "&UserId=-1&FormName=" + fid + "&input_index=0&act=Print";
            return url;
        }
    }
}


